<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">

<body th:fragment="validate">
	<!-- <script th:src="@{|${theme}/plugins/jquery-validation/dist/jquery.validate.min.js|}" src="/themes/lte/plugins/jquery-validation/dist/jquery.validate.min.js"></script>
	<script th:src="@{|${theme}/plugins/jquery-validation/dist/additional-methods.min.js|}" src="/themes/lte/plugins/jquery-validation/dist/additional-methods.min.js"></script>
	<script th:src="@{|${theme}/plugins/jquery-validation/dist/localization/messages_zh.min.js|}"
	  src="/themes/lte/plugins/jquery-validation/dist/localization/messages_zh.min.js"></script>
	<script th:src="@{|${theme}/dist/js/setup_validation.js|}" src="/themes/inspinia/js/setup_validation.js"></script> -->
	<script th:src="@{|${theme}/plugins/validate/jquery.validate.min.js|}"></script>
	<script th:src="@{|${theme}/plugins/validate/additional-methods.min.js|}"></script>
	<script th:src="@{|${theme}/plugins/validate/localization/messages_zh.min.js|}"></script>
	<!-- custome jquery validate -->
	<script th:src="@{|${theme}/plugins/validate/jquery.validate.extend.js|}"></script>
	<script>
		// JQuery validation init
		if ($.validator) {
		  $.extend($.validator.defaults, {
		    errorPlacement: function(error, element) {
	    	  var el = element.parent().find('.select2-container');
		      if(el.length){
		        error.insertAfter( el );
		      }else{      
		        error.insertAfter( element );
		      }
		    }
		  });
		}
	</script>
</body>

</html>